package com.zijie.hosptal.mapper;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zijie.hosptal.pojo.po.Department;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface DepartmentMapper extends BaseMapper<Department> {
    default Page<Department> findList(Page<Department> departmentPage, Department department){
        LambdaQueryWrapper<Department> query = Wrappers.lambdaQuery(department);
        return selectPage(departmentPage, query);
    }

    @Update("update department set price = #{price} where id = #{id}")
    int updateDepartmentPrice(Department department);

}
